export function pages (currenPage, page, dom, event, pageCount, size) {
  if (page === 0) {
    currenPage = 0
  } else if (page === pageCount) {
    currenPage = parseInt(pageCount - 1)
  } else if (page === '下一页') {
    console.log('')
  } else if (page === '上一页') {
    console.log('')
  } else {
    currenPage = parseInt(event) - 1
  }
  if (currenPage < size) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = j * 60 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  } else if (currenPage >= size && currenPage <= parseInt(pageCount)) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = (j - currenPage + 2) * 60 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  }
  dom[currenPage].style.backgroundColor = 'rgb(15,113,213)'
  dom[currenPage].style.color = 'rgb(255,255,255)'
}

export function fenpage (dom, size) {
  for (let i = 0; i < size; i++) {
    dom[i].style.left = i * 60 + 'px'
    dom[i].style.transition = 'left 0.5s'
  }
}

export function pages2 (currenPage, dom, pageCount, size) {
  if (currenPage < size) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = j * 50 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  } else if (currenPage >= size && currenPage <= parseInt(pageCount)) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = (j - currenPage + 3) * 50 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  }
  dom[currenPage].style.backgroundColor = 'rgb(15,113,213)'
  dom[currenPage].style.color = 'rgb(255,255,255)'
}

export function fenpage2 (dom, size) {
  for (let i = 0; i < size; i++) {
    dom[i].style.left = i * 50 + 'px'
    dom[i].style.transition = 'left 0.5s'
  }
}

export function fenpage3 (dom, size) {
  for (let i = 0; i < size; i++) {
    dom[i].style.left = i * 50 + 'px'
    dom[i].style.transition = 'left 0.5s'
  }
}

export function pages3 (currenPage, dom, pageCount, size) {
  if (currenPage < size) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = j * 50 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  } else if (currenPage >= size && currenPage <= parseInt(pageCount)) {
    for (let j = 0; j < pageCount; j++) {
      dom[j].style.left = (j - currenPage + 3) * 50 + 'px'
      dom[j].style.backgroundColor = 'rgb(255,255,255)'
      dom[j].style.color = 'rgb(0,0,0)'
    }
  }
  dom[currenPage].style.backgroundColor = 'rgb(15,113,213)'
  dom[currenPage].style.color = 'rgb(255,255,255)'
}
